			
_unit = player;
_dam = getDammage _unit;
_dif = 1 - _dam;
_total = _dif * 100;
_hp = round _total;
_ui = uiNamespace getVariable "HUD";

if (_hp ==100) then 
{
	(_ui displayCtrl 1002) ctrlSetTextColor [0.2157,0.6863,0.0000,1.0000];
	(_ui displayCtrl 1003) ctrlSetText "100";
};
if ((_hp <100) && (_hp >80)) then 
{
	(_ui displayCtrl 1002) ctrlSetTextColor [0.2157,0.6863,0.0000,1.0000];
	(_ui displayCtrl 1003) ctrlSetText format ["%1", _hp];
	_unit setHit ["hands", 0.9];
};
if ((_hp <80) && (_hp >60)) then 
{
	(_ui displayCtrl 1002) ctrlSetTextColor [0.7059,0.8431,0.0000,1.0000];
	(_ui displayCtrl 1003) ctrlSetText format ["%1", _hp];
	_unit setHit ["body", 0.9];
}; 
if ((_hp <60) && (_hp >40)) then 
{
	(_ui displayCtrl 1002) ctrlSetTextColor [1.0000,0.8941,0.0000,1.0000];
	(_ui displayCtrl 1003) ctrlSetText format ["%1", _hp];
	_unit setHit ["legs", 0.9];
};
if ((_hp <40) && (_hp >20)) then 
{
	(_ui displayCtrl 1002) ctrlSetTextColor [1.0000,0.5020,0.0000,1.0000];
	(_ui displayCtrl 1003) ctrlSetText format ["%1", _hp];
	_unit setHit ["head", 0.9];
};
if ((_hp <20) && (_hp >0)) then 
{
	(_ui displayCtrl 1002) ctrlSetTextColor [0.8000,0.0000,0.0000,1.0000];
	(_ui displayCtrl 1003) ctrlSetText format ["%1", _hp];
	_unit setHit ["legs", 1];
};
if (!alive _unit) then 
{
	(_ui displayCtrl 1002) ctrlSetTextColor [0.8000,0.0000,0.0000,1.0000];
	(_ui displayCtrl 1003) ctrlSetText "0";
	_unit setHit ["hands", 1];
	_unit setHit ["body", 1];
	_unit setHit ["head", 1];
};